package com.liangsui.mss.utils;

import org.apache.shiro.crypto.hash.Md5Hash;

import java.util.UUID;

/**
 * AppMd5Utils
 * 生成md5密码
 * @author zhangjiawei
 * @email 1533167396@qq.com
 * @date 2022/12/5 16:57
 */
public class AppMd5Utils {
    /**
     * 生成盐
     */
    public static String createSalt(){
        return UUID.randomUUID().toString().replace("-","").toUpperCase();
    }

    /**
     * 生成加密字符串
     */
    public static String md5(String source,String salt,Integer hashIterations){
        return new Md5Hash(source, salt, hashIterations).toString();
    }

}
